import 'package:flutter/cupertino.dart';
import 'package:flutter_public/foundation/decoration/linear_gradient_decoration.dart';

import '../support/theme_color.dart';

/// FileName activity_linear_gradient_container
///
/// @Author lax
/// @Date 2024/3/7
///
/// @Description

class ActivityLinearGradientContainer extends Container {
  ActivityLinearGradientContainer({
    super.key,
    EdgeInsets? margin,
    EdgeInsets? padding,
    double? radius = 8,
    Axis direction = Axis.horizontal,
    bool highlight = false,
    List<Color>? colors,
    Widget? child,
  }) : super(
          margin: margin,
          padding: padding,
          decoration: LinearGradientDecoration(
            radius: radius,
            begin: direction == Axis.horizontal ? null : Alignment.bottomCenter,
            end: direction == Axis.horizontal ? null : Alignment.topCenter,
            colors: colors ??
                (highlight
                    ? [ThemeColor.activityPrimary, ThemeColor.activityLightPrimary]
                    : [
                        ThemeColor.activityAlphaBg,
                        ThemeColor.activityAlphaLightBg
                      ]),
          ),
          child: child,
        );
}
